#ifndef LCD_DISPLAY_H
#define LCD_DISPLAY_H

#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_ops.h>

#include "display.h"

class LcdDisplay : public Display {
   protected:
    esp_lcd_panel_io_handle_t panel_io_ = nullptr;
    esp_lcd_panel_handle_t panel_ = nullptr;

   protected:
    LcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel) : panel_io_(panel_io), panel_(panel) {};

   public:
    ~LcdDisplay();

    virtual bool Lock(int timeout_ms = 0) override;
    virtual void Unlock() override;
};

// // SPI LCD显示器
class SpiLcdDisplay : public LcdDisplay {
   public:
    SpiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel, int width, int height, bool mirror_x, bool mirror_y, bool swap_xy);
};

#endif  // LCD_DISPLAY_H
